package morenoapp.action;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import morenoapp.tools.MorenoTool;
import morenoapp.util.MorenoUtil;
import org.apache.commons.io.FileUtils;
import org.jdesktop.application.Action;

/**
 *
 * @author dmitry.mamonov
 */
public class MorenoActionsFacade {
    //generated:begin
    public static javax.swing.Action getActionCreateNewModel(){
        return MorenoActions.getInstance().getAction("actionCreateNewModel");
    }
    public static javax.swing.Action getActionImportResearch(){
        return MorenoActions.getInstance().getAction("actionImportResearch");
    }
    public static javax.swing.Action getActionNavigateNext(){
        return MorenoActions.getInstance().getAction("actionNavigateNext");
    }
    public static javax.swing.Action getActionNavigatePrev(){
        return MorenoActions.getInstance().getAction("actionNavigatePrev");
    }
    public static javax.swing.Action getActionNavigateWelcome(){
        return MorenoActions.getInstance().getAction("actionNavigateWelcome");
    }
    public static javax.swing.Action getActionNavigateStartWork(){
        return MorenoActions.getInstance().getAction("actionNavigateStartWork");
    }
    public static javax.swing.Action getActionShowAppHelp(){
        return MorenoActions.getInstance().getAction("actionShowAppHelp");
    }
    public static javax.swing.Action getActionCallSupport(){
        return MorenoActions.getInstance().getAction("actionCallSupport");
    }
    public static javax.swing.Action getActionOpenModel(){
        return MorenoActions.getInstance().getAction("actionOpenModel");
    }
    public static javax.swing.Action getActionSaveModel(){
        return MorenoActions.getInstance().getAction("actionSaveModel");
    }
    public static javax.swing.Action getActionSaveAsModel(){
        return MorenoActions.getInstance().getAction("actionSaveAsModel");
    }
    public static javax.swing.Action getActionCloseModel(){
        return MorenoActions.getInstance().getAction("actionCloseModel");
    }
    public static javax.swing.Action getActionExitApp(){
        return MorenoActions.getInstance().getAction("actionExitApp");
    }
    public static javax.swing.Action getActionDummy(){
        return MorenoActions.getInstance().getAction("actionDummy");
    }
    public static javax.swing.Action getActionAbout(){
        return MorenoActions.getInstance().getAction("actionAbout");
    }
    public static javax.swing.Action getActionSubmitIssue(){
        return MorenoActions.getInstance().getAction("actionSubmitIssue");
    }
    public static javax.swing.Action getActionDebugSavelAllComponentsAsImages(){
        return MorenoActions.getInstance().getAction("actionDebugSavelAllComponentsAsImages");
    }
    public static javax.swing.Action getActionDebugSaveImportantComponentsAsImages(){
        return MorenoActions.getInstance().getAction("actionDebugSaveImportantComponentsAsImages");
    }
    public static javax.swing.Action getActionDebugMakeScreenshots(){
        return MorenoActions.getInstance().getAction("actionDebugMakeScreenshots");
    }
    public static javax.swing.Action getActionSetUILanguageRussian(){
        return MorenoActions.getInstance().getAction("actionSetUILanguageRussian");
    }
    public static javax.swing.Action getActionSetUILanguageEnglish(){
        return MorenoActions.getInstance().getAction("actionSetUILanguageEnglish");
    }
    public static javax.swing.Action getActionSwitchToWizardView(){
        return MorenoActions.getInstance().getAction("actionSwitchToWizardView");
    }
    public static javax.swing.Action getActionSwitchToTabbedView(){
        return MorenoActions.getInstance().getAction("actionSwitchToTabbedView");
    }
    public static javax.swing.Action getActionToggleNetworkOption(){
        return MorenoActions.getInstance().getAction("actionToggleNetworkOption");
    }
    public static javax.swing.Action getActionToggleWizardMode(){
        return MorenoActions.getInstance().getAction("actionToggleWizardMode");
    }
    public static javax.swing.Action getActionDebugResetInstallID(){
        return MorenoActions.getInstance().getAction("actionDebugResetInstallID");
    }
    public static javax.swing.Action getActionExceptionDialogHide(){
        return MorenoActions.getInstance().getAction("actionExceptionDialogHide");
    }
    public static javax.swing.Action getActionExceptionDialogSubmit(){
        return MorenoActions.getInstance().getAction("actionExceptionDialogSubmit");
    }
    public static javax.swing.Action getActionThrowException(){
        return MorenoActions.getInstance().getAction("actionThrowException");
    }
    //generated:end

    /**
     * Simply prints actions-properties viewing by declared fields.
     * @param args
     */
    public static void main(String[] args) throws IOException {
        List<String> generatedCode = new ArrayList<String>();
        
        //add generated body
        for (Method m : MorenoUtil.filterAndSortMethodsByOrder(MorenoActions.class.getMethods())) {
            if (m.getAnnotation(Action.class) != null) {
                String capitalizedName = m.getName().substring(0, 1).toUpperCase() + m.getName().substring(1);
                generatedCode.add(String.format("    public static javax.swing.Action get%s(){", capitalizedName));
                generatedCode.add(String.format("        return MorenoActions.getInstance().getAction(\"%s\");", m.getName()));
                generatedCode.add(String.format("    }"));
            }
        }
        MorenoTool.updateSourceFile(MorenoActionsFacade.class, generatedCode);
        MorenoTool.updateResources(new File("src"), MorenoActions.class);

    }

}
